package com.mmc.delay.bean;

import java.io.Serializable;

public abstract class AbstractJob implements Serializable {


    /**
     * 任务id，保持全局唯一
     */
    private String jobId;

    /**
     * 主题
     */
    private String topic;

    /**
     * 消息内容，json格式
     */
    private String body;

    /**
     * 重试次数
     */
    private int retries;

    /**
     * 延迟时间，单位毫秒
     */
    private long delayTime;

    public AbstractJob(){

    }

    public AbstractJob(String jobId, String topic, String body, int retries, long delayTime) {
        this.jobId = jobId;
        this.topic = topic;
        this.body = body;
        this.retries = retries;
        this.delayTime = delayTime;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }


    public int getRetries() {
        return retries;
    }

    public void setRetries(int retries) {
        this.retries = retries;
    }

    public long getDelayTime() {
        return delayTime;
    }

    public void setDelayTime(long delayTime) {
        this.delayTime = delayTime;
    }

    @Override
    public String toString() {
        return  "jobId=" + jobId +
                ", topic='" + topic + '\'' +
                ", body='" + body + '\'' +
                ", retries=" + retries +
                ", delayTime=" + delayTime;
    }
}
